package com.gz.WeChatSys.service.impl;


import com.gz.WeChatSys.dao.WxUserMapper;
import com.gz.WeChatSys.model.WxUser;
import com.gz.WeChatSys.service.WxUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 中汇天成 on 2017/11/2.
 */
@Service
public class WxUserServiceImpl implements WxUserService {
    @Resource
    private WxUserMapper wxUserMapper;
//    @Resource
//    private ReportMapper reportMapper;

    @Override
    public Integer insert(WxUser wxUser) {
        Integer num = wxUserMapper.insertSelective(wxUser);
        return num;
    }

    @Override
    public WxUser getWxUser(String openId) {
        return wxUserMapper.getWxUser(openId);
    }


//    @Override
//    public DataGrid getMyReport(String openId, Report report) {
//        WxUser wxUser = wxUserMapper.getWxUser(openId);
//        report.setCreaterId(wxUser.getWxUserId());
//        report.setSort("add_time");
//        report.setOrder("desc");
//        BasePage.needPage(report);
//        List<ReportDto> reports = reportMapper.getWxReportList(report);
//        DataGrid dataGrid = DataGrid.pageData(reports);
//        return dataGrid;
//    }

}
